<extend name="./Application/Admin/View/Layout/application.html"/>

<block name="content">
    <!--左侧-->
    <div class="col-sm-9">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">栏目管理</h3>
            </div>
            <div class="panel-body">
                <form action="" method="post" class="form">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th><input type="checkbox" class="parent_checked"></th>
                            <th>ID</th>
                            <th>父级栏目名</th>
                            <th>栏目名</th>
                            <th>类型</th>
                            <th>URL</th>
                            <th>是否显示</th>
                            <th>排序</th>
                            <th colspan="2">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="categories" id="category">
                            <tr>
                                <td><input type="checkbox" class="child_checked" name="id[]" value="{{$category.id}}">
                                </td>
                                <td>{{$category.id}}</td>
                                <td></td>
                                <td>{{$category.name}}</td>
                                <td>{{$category.type}}</td>
                                <td>{{$category.url}}</td>
                                <td class="">
                                    <eq name="category.is_show" value="1">
                                        <span class="glyphicon glyphicon-thumbs-up" style="color: #047d65"></span>
                                    <else/>
                                        <span class="glyphicon glyphicon-thumbs-down" style="color: #9f041b"></span>
                                    </eq>

                                </td>
                                <td>
                                    <input type="hidden" name="id[]" value="{{$category.id}}">
                                    <input type="text" name="sort_order[]" style="width:30px;"
                                           value="{{$category.sort_order}}">
                                </td>
                                <td><a href="{{:U('edit', array('id'=>$category['id']))}}"><span
                                        class="glyphicon glyphicon-pencil"
                                        aria-hidden="true"></span></a></td>
                                <td><a href="{{:U('delete', array('id'=>$category['id']))}}"><span
                                        class="glyphicon glyphicon-trash"
                                        aria-hidden="true"></span></a>
                                </td>
                                <!--U里面数组带值只能使用方括号-->
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>

    </div>
    <!--右侧-->
    <div class="col-sm-3">
        <ul class="list-group">
            <a href="{{:U('add')}}" class="add list-group-item list-group-item-warning">添加栏目</a>
            <a href="javascript:void 0;" class="delete_all list-group-item list-group-item-danger">删除栏目</a>
            <a href="javascript:void 0;" class="sort_order list-group-item list-group-item-success">排序栏目</a>
        </ul>
    </div>

</block>

